package com.dili.dd.gpi.mapper;

import com.dili.dd.gpi.domain.EventParam;
import com.dili.dd.gpi.domain.EventParamExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface EventParamMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    int countByExample(EventParamExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    int deleteByExample(EventParamExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    @Delete({
        "delete from event_param",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    @Insert({
        "insert into event_param (event_id, param_name, ",
        "param_type, ",
        "param_desc, create_date, ",
        "update_date)",
        "values (#{eventId,jdbcType=VARCHAR}, #{paramName,jdbcType=VARCHAR}, ",
        "#{paramType,jdbcType=VARCHAR,typeHandler=org.apache.ibatis.type.EnumTypeHandler}, ",
        "#{paramDesc,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateDate,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(EventParam record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    int insertSelective(EventParam record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    List<EventParam> selectByExample(EventParamExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    @Select({
        "select",
        "id, event_id, param_name, param_type, param_desc, create_date, update_date",
        "from event_param",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    EventParam selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    int updateByExampleSelective(@Param("record") EventParam record, @Param("example") EventParamExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    int updateByExample(@Param("record") EventParam record, @Param("example") EventParamExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    int updateByPrimaryKeySelective(EventParam record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table event_param
     *
     * @mbggenerated Tue Oct 20 15:11:20 CST 2015
     */
    @Update({
        "update event_param",
        "set event_id = #{eventId,jdbcType=VARCHAR},",
          "param_name = #{paramName,jdbcType=VARCHAR},",
          "param_type = #{paramType,jdbcType=VARCHAR,typeHandler=org.apache.ibatis.type.EnumTypeHandler},",
          "param_desc = #{paramDesc,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(EventParam record);
}